package com.service.journal.JournalServiceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dao.Journal.JournalDao;
import com.entity.journal.Journal;
import com.entity.journal.JournalCategory;
import com.entity.journal.JournalComment;
import com.entity.journal.JournalVisitor;
import com.service.journal.JournalService;
import com.util.dao.BasicDao;

@Service("journalService")
public class JournalServiceImpl implements JournalService {
	
	@Autowired
	private BasicDao basicDao;
	
	@Autowired
	private JournalDao journalDao;

	public List<JournalComment> getCommentList(Integer journalId)
			throws Exception {
		return (List<JournalComment>)journalDao.getJournalCommentList(journalId);
	}

	public List<Journal> getJournalList(Integer userId) throws Exception {
		return (List<Journal>)journalDao.getJournalList(userId);
	}

	public List<JournalVisitor> getVisitorList(Integer journalId) throws Exception {
		return (List<JournalVisitor>)journalDao.getVisitorList(journalId);
	}

	public void saveCategory(JournalCategory journalCategory) throws Exception {
        basicDao.saveOrUpdate(journalCategory);		
	}

}
